home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-08-17 | 58.4 KB | 1,727 lines | [ TEXT/MPS ]
; ; File: MacWindows.a ; ; Contains: Window Manager Interfaces. ; ; Version: Technology: Mac OS 8.5 ; Release: Universal Interfaces 3.2 ; ; Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved ; ; Bugs?: For bug reports, consult the following page on ; the World Wide Web: ; ; http://developer.apple.com/bugreporter/ ; ; IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN __MACWINDOWS__ SET 1 IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN include 'MacTypes.a' ENDIF IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN include 'Aliases.a' ENDIF IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN include 'AppleEvents.a' ENDIF IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN include 'Collections.a' ENDIF IF &TYPE('__DRAG__') = 'UNDEFINED' THEN include 'Drag.a' ENDIF IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN include 'Events.a' ENDIF IF &TYPE('__MENUS__') = 'UNDEFINED' THEN include 'Menus.a' ENDIF IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN include 'MixedMode.a' ENDIF IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN include 'QDOffscreen.a' ENDIF IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN include 'Quickdraw.a' ENDIF IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN include 'TextCommon.a' ENDIF IF &TYPE('__ICONS__') = 'UNDEFINED' THEN include 'Icons.a' ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Property Types (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef OSType PropertyCreator ; typedef OSType PropertyTag ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Classes (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef UInt32 WindowClass kAlertWindowClass EQU 1 ; “I need your attention now.” kMovableAlertWindowClass EQU 2 ; “I need your attention now, but I’m kind enough to let you switch out of this app to do other things.” kModalWindowClass EQU 3 ; system modal, not draggable kMovableModalWindowClass EQU 4 ; application modal, draggable kFloatingWindowClass EQU 5 ; floats above all other application windows kDocumentWindowClass EQU 6 ; everything else ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Attributes (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef UInt32 WindowAttributes kWindowNoAttributes EQU 0 ; no attributes kWindowCloseBoxAttribute EQU $00000001 ; window has a close box kWindowHorizontalZoomAttribute EQU $00000002 ; window has horizontal zoom box kWindowVerticalZoomAttribute EQU $00000004 ; window has vertical zoom box kWindowFullZoomAttribute EQU $00000006 kWindowCollapseBoxAttribute EQU $00000008 ; window has a collapse box kWindowResizableAttribute EQU $00000010 ; window is resizable kWindowSideTitlebarAttribute EQU $00000020 ; window wants a titlebar on the side (floating window class only) kWindowNoUpdatesAttribute EQU $00010000 ; this window receives no update events kWindowNoActivatesAttribute EQU $00020000 ; this window receives no activate events kWindowStandardDocumentAttributes EQU $0000001F kWindowStandardFloatingAttributes EQU $00000009 ; —————————————————————————————————————————————————————————————————————————————————————— ; • Errors & Gestalt (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— gestaltWindowMgrAttr EQU 'wind' ; If this Gestalt exists, the Mac OS 8.5 Window Manager is installed gestaltWindowMgrPresent EQU $00000001 errInvalidWindowPtr EQU -5600 ; tried to pass a bad WindowPtr argument errUnsupportedWindowAttributesForClass EQU -5601 ; tried to create a window with WindowAttributes not supported by the WindowClass errWindowDoesNotHaveProxy EQU -5602 ; tried to do something requiring a proxy to a window which doesn’t have a proxy errInvalidWindowProperty EQU -5603 ; tried to access a property tag with private creator errWindowPropertyNotFound EQU -5604 ; tried to get a nonexistent property errUnrecognizedWindowClass EQU -5605 ; tried to create a window with a bad WindowClass errCorruptWindowDescription EQU -5606 ; tried to load a corrupt window description (size or version fields incorrect) errUserWantsToDragWindow EQU -5607 ; if returned from TrackWindowProxyDrag, you should call DragWindow on the window errWindowsAlreadyInitialized EQU -5608 ; tried to call InitFloatingWindows twice, or called InitWindows and then floating windows errFloatingWindowsNotInitialized EQU -5609 ; called HideFloatingWindows or ShowFloatingWindows without calling InitFloatingWindows ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Definition Type ; —————————————————————————————————————————————————————————————————————————————————————— kWindowDefProcType EQU 'WDEF' ; —————————————————————————————————————————————————————————————————————————————————————— ; • Mac OS 7.5 Window Definition Resource IDs ; —————————————————————————————————————————————————————————————————————————————————————— kStandardWindowDefinition EQU 0 ; for document windows and dialogs kRoundWindowDefinition EQU 1 ; old da-style window kFloatingWindowDefinition EQU 124 ; for floating windows ; —————————————————————————————————————————————————————————————————————————————————————— ; • Variant Codes ; —————————————————————————————————————————————————————————————————————————————————————— ; for use with kStandardWindowDefinition kDocumentWindowVariantCode EQU 0 kModalDialogVariantCode EQU 1 kPlainDialogVariantCode EQU 2 kShadowDialogVariantCode EQU 3 kMovableModalDialogVariantCode EQU 5 kAlertVariantCode EQU 7 kMovableAlertVariantCode EQU 9 ; for use with kFloatingWindowDefinition kSideFloaterVariantCode EQU 8 ; —————————————————————————————————————————————————————————————————————————————————————— ; • DefProc IDs ; —————————————————————————————————————————————————————————————————————————————————————— ; classic ids documentProc EQU 0 dBoxProc EQU 1 plainDBox EQU 2 altDBoxProc EQU 3 noGrowDocProc EQU 4 movableDBoxProc EQU 5 zoomDocProc EQU 8 zoomNoGrow EQU 12 rDocProc EQU 16 ; floating window defproc ids floatProc EQU 1985 floatGrowProc EQU 1987 floatZoomProc EQU 1989 floatZoomGrowProc EQU 1991 floatSideProc EQU 1993 floatSideGrowProc EQU 1995 floatSideZoomProc EQU 1997 floatSideZoomGrowProc EQU 1999 ; Resource IDs for theme-savvy window defprocs kWindowDocumentDefProcResID EQU 64 kWindowDialogDefProcResID EQU 65 kWindowUtilityDefProcResID EQU 66 kWindowUtilitySideTitleDefProcResID EQU 67 ; Proc IDs for theme-savvy windows kWindowDocumentProc EQU 1024 kWindowGrowDocumentProc EQU 1025 kWindowVertZoomDocumentProc EQU 1026 kWindowVertZoomGrowDocumentProc EQU 1027 kWindowHorizZoomDocumentProc EQU 1028 kWindowHorizZoomGrowDocumentProc EQU 1029 kWindowFullZoomDocumentProc EQU 1030 kWindowFullZoomGrowDocumentProc EQU 1031 ; Proc IDs for theme-savvy dialogs kWindowPlainDialogProc EQU 1040 kWindowShadowDialogProc EQU 1041 kWindowModalDialogProc EQU 1042 kWindowMovableModalDialogProc EQU 1043 kWindowAlertProc EQU 1044 kWindowMovableAlertProc EQU 1045 ; procIDs available in Mac OS 8.1 (Appearance 1.0.1) or later kWindowMovableModalGrowProc EQU 1046 ; Proc IDs for top title bar theme-savvy floating windows kWindowFloatProc EQU 1057 kWindowFloatGrowProc EQU 1059 kWindowFloatVertZoomProc EQU 1061 kWindowFloatVertZoomGrowProc EQU 1063 kWindowFloatHorizZoomProc EQU 1065 kWindowFloatHorizZoomGrowProc EQU 1067 kWindowFloatFullZoomProc EQU 1069 kWindowFloatFullZoomGrowProc EQU 1071 ; Proc IDs for side title bar theme-savvy floating windows kWindowFloatSideProc EQU 1073 kWindowFloatSideGrowProc EQU 1075 kWindowFloatSideVertZoomProc EQU 1077 kWindowFloatSideVertZoomGrowProc EQU 1079 kWindowFloatSideHorizZoomProc EQU 1081 kWindowFloatSideHorizZoomGrowProc EQU 1083 kWindowFloatSideFullZoomProc EQU 1085 kWindowFloatSideFullZoomGrowProc EQU 1087 ; —————————————————————————————————————————————————————————————————————————————————————— ; • System 7 Window Positioning Constants ; ; Passed into StandardAlert and used in ‘WIND’, ‘DLOG’, and ‘ALRT’ templates ; StandardAlert uses zero to specify the default position. Other calls use zero to ; specify “no position”. Do not pass these constants to RepositionWindow. Do not ; store these constants in the BasicWindowDescription of a ‘wind’ resource. ; —————————————————————————————————————————————————————————————————————————————————————— kWindowNoPosition EQU $0000 kWindowDefaultPosition EQU $0000 ; used by StandardAlert kWindowCenterMainScreen EQU $280A kWindowAlertPositionMainScreen EQU $300A kWindowStaggerMainScreen EQU $380A kWindowCenterParentWindow EQU $A80A kWindowAlertPositionParentWindow EQU $B00A kWindowStaggerParentWindow EQU $B80A kWindowCenterParentWindowScreen EQU $680A kWindowAlertPositionParentWindowScreen EQU $700A kWindowStaggerParentWindowScreen EQU $780A ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Positioning Methods (Mac OS 8.5 and later) ; ; Positioning methods passed to RepositionWindow. ; Do not use them in WIND, ALRT, DLOG templates. ; Do not confuse these constants with the constants above ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef UInt32 WindowPositionMethod kWindowCenterOnMainScreen EQU $00000001 kWindowCenterOnParentWindow EQU $00000002 kWindowCenterOnParentWindowScreen EQU $00000003 kWindowCascadeOnMainScreen EQU $00000004 kWindowCascadeOnParentWindow EQU $00000005 kWIndowCascadeOnParentWindowScreen EQU $00000006 kWindowAlertPositionOnMainScreen EQU $00000007 kWindowAlertPositionOnParentWindow EQU $00000008 kWindowAlertPositionOnParentWindowScreen EQU $00000009 ; —————————————————————————————————————————————————————————————————————————————————————— ; • GetWindowRegion Types ; —————————————————————————————————————————————————————————————————————————————————————— ; Region values to pass into GetWindowRegion kWindowTitleBarRgn EQU 0 kWindowTitleTextRgn EQU 1 kWindowCloseBoxRgn EQU 2 kWindowZoomBoxRgn EQU 3 kWindowDragRgn EQU 5 kWindowGrowRgn EQU 6 kWindowCollapseBoxRgn EQU 7 kWindowTitleProxyIconRgn EQU 8 ; Mac OS 8.5 and later kWindowStructureRgn EQU 32 kWindowContentRgn EQU 33 ; typedef UInt16 WindowRegionCode ; GetWindowRegionRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion GetWindowRegionRec RECORD 0 winRgn ds.l 1 ; offset: $0 (0) regionCode ds.w 1 ; offset: $4 (4) sizeof EQU * ; size: $6 (6) ENDR ; typedef struct GetWindowRegionRec * GetWindowRegionPtr ; typedef struct GetWindowRegionRec * GetWindowRegionRecPtr ; —————————————————————————————————————————————————————————————————————————————————————— ; • WDEF Message Types (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; SetupWindowProxyDragImageRec - setup the proxy icon drag image ; Both regions are allocated and disposed by the Window Manager. ; The GWorld is disposed of by the Window Manager, but the WDEF must allocate ; it. See Technote on Drag Manager 1.1 additions for more information and sample code for ; setting up drag images. SetupWindowProxyDragImageRec RECORD 0 imageGWorld ds.l 1 ; offset: $0 (0) ; locked GWorld containing the drag image - output - can be NULL imageRgn ds.l 1 ; offset: $4 (4) ; image clip region, contains the portion of the image which gets blitted to screen - preallocated output - if imageGWorld is NULL, this is ignored outlineRgn ds.l 1 ; offset: $8 (8) ; the outline region used on shallow monitors - preallocated output - must always be non-empty sizeof EQU * ; size: $C (12) ENDR ; MeasureWindowTitleRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion MeasureWindowTitleRec RECORD 0 ; output parameters fullTitleWidth ds.w 1 ; offset: $0 (0) ; text + proxy icon width titleTextWidth ds.w 1 ; offset: $2 (2) ; text width ; input parameters isUnicodeTitle ds.b 1 ; offset: $4 (4) unused ds.b 1 ; offset: $5 (5) ; future use sizeof EQU * ; size: $6 (6) ENDR ; typedef struct MeasureWindowTitleRec * MeasureWindowTitleRecPtr ; —————————————————————————————————————————————————————————————————————————————————————— ; • Standard Window Kinds ; —————————————————————————————————————————————————————————————————————————————————————— dialogKind EQU 2 userKind EQU 8 kDialogWindowKind EQU 2 kApplicationWindowKind EQU 8 ; —————————————————————————————————————————————————————————————————————————————————————— ; • FindWindow Result Codes ; —————————————————————————————————————————————————————————————————————————————————————— inDesk EQU 0 inNoWindow EQU 0 inMenuBar EQU 1 inSysWindow EQU 2 inContent EQU 3 inDrag EQU 4 inGrow EQU 5 inGoAway EQU 6 inZoomIn EQU 7 inZoomOut EQU 8 inCollapseBox EQU 11 ; Mac OS 8.0 and later inProxyIcon EQU 12 ; Mac OS 8.5 and later ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Definition Hit Test Result Codes ; —————————————————————————————————————————————————————————————————————————————————————— wNoHit EQU 0 wInContent EQU 1 wInDrag EQU 2 wInGrow EQU 3 wInGoAway EQU 4 wInZoomIn EQU 5 wInZoomOut EQU 6 wInCollapseBox EQU 9 ; Mac OS 8.0 and later wInProxyIcon EQU 10 ; Mac OS 8.5 and later ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Definition Messages ; —————————————————————————————————————————————————————————————————————————————————————— kWindowMsgDraw EQU 0 kWindowMsgHitTest EQU 1 kWindowMsgCalculateShape EQU 2 kWindowMsgInitialize EQU 3 kWindowMsgCleanUp EQU 4 kWindowMsgDrawGrowOutline EQU 5 kWindowMsgDrawGrowBox EQU 6 ; Messages available in Mac OS 8.0 and later kWindowMsgGetFeatures EQU 7 kWindowMsgGetRegion EQU 8 ; Messages available in Mac OS 8.5 and later kWindowMsgDragHilite EQU 9 ; parameter boolean indicating on or off kWindowMsgModified EQU 10 ; parameter boolean indicating saved (false) or modified (true) kWindowMsgDrawInCurrentPort EQU 11 ; same as kWindowMsgDraw, but must draw in current port kWindowMsgSetupProxyDragImage EQU 12 ; parameter pointer to SetupWindowProxyDragImageRec kWindowMsgStateChanged EQU 13 ; something about the window's state has changed kWindowMsgMeasureTitle EQU 14 ; measure and return the ideal title width ; old names wDraw EQU 0 wHit EQU 1 wCalcRgns EQU 2 wNew EQU 3 wDispose EQU 4 wGrow EQU 5 wDrawGIcon EQU 6 ; —————————————————————————————————————————————————————————————————————————————————————— ; • State-changed Flags for kWindowMsgStateChanged (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— kWindowStateTitleChanged EQU $01 kWindowStateSizeChanged EQU $02 kWindowStatePositionChanged EQU $04 kWindowStateZOrderChanged EQU $08 kWindowStateVisibilityChanged EQU $10 kWindowStateHiliteChanged EQU $20 kWindowStateCollapseChanged EQU $40 ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Feature Bits ; —————————————————————————————————————————————————————————————————————————————————————— kWindowCanGrow EQU $01 kWindowCanZoom EQU $02 kWindowCanCollapse EQU $04 kWindowIsModal EQU $08 kWindowCanGetWindowRegion EQU $10 kWindowIsAlert EQU $20 kWindowHasTitleBar EQU $40 ; Message bits available in Mac OS 8.5 and later kWindowSupportsDragHilite EQU $80 ; window definition supports kWindowMsgDragHilite kWindowSupportsModifiedBit EQU $0100 ; window definition supports kWindowMsgModified kWindowCanDrawInCurrentPort EQU $0200 ; window definition supports kWindowMsgDrawInCurrentPort kWindowCanSetupProxyDragImage EQU $0400 ; window definition supports kWindowMsgSetupProxyDragImage kWindowCanMeasureTitle EQU $0800 ; window definition supports kWindowMsgMeasureTitle kWindowWantsDisposeAtProcessDeath EQU $1000 ; window definition wants a Dispose message for windows still extant during ExitToShell ; —————————————————————————————————————————————————————————————————————————————————————— ; • Desktop Pattern Resource ID ; —————————————————————————————————————————————————————————————————————————————————————— deskPatID EQU 16 ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Color Part Codes ; —————————————————————————————————————————————————————————————————————————————————————— wContentColor EQU 0 wFrameColor EQU 1 wTextColor EQU 2 wHiliteColor EQU 3 wTitleBarColor EQU 4 ; —————————————————————————————————————————————————————————————————————————————————————— ; • Region Dragging Constants ; —————————————————————————————————————————————————————————————————————————————————————— kMouseUpOutOfSlop EQU $80008000 ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Color Table ; —————————————————————————————————————————————————————————————————————————————————————— WinCTab RECORD 0 wCSeed ds.l 1 ; offset: $0 (0) ; reserved wCReserved ds.w 1 ; offset: $4 (4) ; reserved ctSize ds.w 1 ; offset: $6 (6) ; usually 4 for windows ctTable ds.b 5 * ColorSpec.sizeof ; offset: $8 (8) sizeof EQU * ; size: $30 (48) ENDR ; typedef struct WinCTab * WCTabPtr ; typedef WCTabPtr * WCTabHandle ; —————————————————————————————————————————————————————————————————————————————————————— ; • WindowRecord ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef WindowRecord * WindowPeek WindowRecord RECORD 0 port ds GrafPort ; offset: $0 (0) windowKind ds.w 1 ; offset: $6C (108) visible ds.b 1 ; offset: $6E (110) hilited ds.b 1 ; offset: $6F (111) goAwayFlag ds.b 1 ; offset: $70 (112) spareFlag ds.b 1 ; offset: $71 (113) strucRgn ds.l 1 ; offset: $72 (114) contRgn ds.l 1 ; offset: $76 (118) updateRgn ds.l 1 ; offset: $7A (122) windowDefProc ds.l 1 ; offset: $7E (126) dataHandle ds.l 1 ; offset: $82 (130) titleHandle ds.l 1 ; offset: $86 (134) titleWidth ds.w 1 ; offset: $8A (138) controlList ds.l 1 ; offset: $8C (140) nextWindow ds.l 1 ; offset: $90 (144) windowPic ds.l 1 ; offset: $94 (148) refCon ds.l 1 ; offset: $98 (152) sizeof EQU * ; size: $9C (156) ENDR ; —————————————————————————————————————————————————————————————————————————————————————— ; • Color WindowRecord ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef CWindowRecord * CWindowPeek CWindowRecord RECORD 0 port ds CGrafPort ; offset: $0 (0) windowKind ds.w 1 ; offset: $6C (108) visible ds.b 1 ; offset: $6E (110) hilited ds.b 1 ; offset: $6F (111) goAwayFlag ds.b 1 ; offset: $70 (112) spareFlag ds.b 1 ; offset: $71 (113) strucRgn ds.l 1 ; offset: $72 (114) contRgn ds.l 1 ; offset: $76 (118) updateRgn ds.l 1 ; offset: $7A (122) windowDefProc ds.l 1 ; offset: $7E (126) dataHandle ds.l 1 ; offset: $82 (130) titleHandle ds.l 1 ; offset: $86 (134) titleWidth ds.w 1 ; offset: $8A (138) controlList ds.l 1 ; offset: $8C (140) nextWindow ds.l 1 ; offset: $90 (144) windowPic ds.l 1 ; offset: $94 (148) refCon ds.l 1 ; offset: $98 (152) sizeof EQU * ; size: $9C (156) ENDR ; —————————————————————————————————————————————————————————————————————————————————————— ; • AuxWinHandle ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef AuxWinRec * AuxWinPtr ; typedef AuxWinPtr * AuxWinHandle AuxWinRec RECORD 0 awNext ds.l 1 ; offset: $0 (0) ; handle to next AuxWinRec awOwner ds.l 1 ; offset: $4 (4) ; ptr to window awCTable ds.l 1 ; offset: $8 (8) ; color table for this window reserved ds.l 1 ; offset: $C (12) awFlags ds.l 1 ; offset: $10 (16) ; reserved for expansion awReserved ds.l 1 ; offset: $14 (20) ; reserved for expansion awRefCon ds.l 1 ; offset: $18 (24) ; user Constant sizeof EQU * ; size: $1C (28) ENDR ; —————————————————————————————————————————————————————————————————————————————————————— ; • BasicWindowDescription (Mac OS 8.5 and later) ; ; Contains statically-sized basic attributes of the window, for storage in a ; collection item. ; —————————————————————————————————————————————————————————————————————————————————————— ; constants for the version field kWindowDefinitionVersionOne EQU 1 kWindowDefinitionVersionTwo EQU 2 ; constants for the stateflags bit field kWindowIsCollapsedState EQU $01 BasicWindowDescription RECORD 0 descriptionSize ds.l 1 ; offset: $0 (0) ; sizeof(BasicWindowDescription) windowContentRect ds Rect ; offset: $4 (4) ; location on screen windowZoomRect ds Rect ; offset: $C (12) ; location on screen when zoomed out windowRefCon ds.l 1 ; offset: $14 (20) ; the refcon - __avoid saving stale pointers here__ windowStateFlags ds.l 1 ; offset: $18 (24) ; flags indicating status of transient window state windowPositionMethod ds.l 1 ; offset: $1C (28) ; method last used by RepositionWindow to position the window (if any) windowDefinitionVersion ds.l 1 ; offset: $20 (32) windowDefProc ds.w 1 ; offset: $24 (36) ; defProc and variant windowHasCloseBox ds.b 1 ; offset: $26 (38) ORG 36 windowClass ds.l 1 ; offset: $24 (36) ; the class windowAttributes ds.l 1 ; offset: $28 (40) ; the attributes sizeof EQU * ; size: $2C (44) ENDR ; the window manager stores the default collection items using these IDs kStoredWindowSystemTag EQU 'appl' ; Only Apple collection items will be of this tag kStoredBasicWindowDescriptionID EQU 'sbas' ; BasicWindowDescription kStoredWindowPascalTitleID EQU 's255' ; pascal title string ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Class Ordering ; ; Special cases for the “behind” parameter in window creation calls. ; —————————————————————————————————————————————————————————————————————————————————————— kFirstWindowOfClass EQU -1 kLastWindowOfClass EQU 0 ; —————————————————————————————————————————————————————————————————————————————————————— ; • Zoom Information Handle ; —————————————————————————————————————————————————————————————————————————————————————— WStateData RECORD 0 userState ds Rect ; offset: $0 (0) ; user zoom state stdState ds Rect ; offset: $8 (8) ; standard zoom state sizeof EQU * ; size: $10 (16) ENDR ; typedef struct WStateData * WStateDataPtr ; typedef WStateDataPtr * WStateDataHandle ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Creation & Persistence ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal WindowPtr GetNewCWindow(short windowID, void *wStorage, WindowPtr behind) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetNewCWindow: OPWORD $AA46 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetNewCWindow ENDIF ; ; pascal WindowPtr NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _NewWindow: OPWORD $A913 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION NewWindow ENDIF ; ; pascal WindowPtr GetNewWindow(short windowID, void *wStorage, WindowPtr behind) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetNewWindow: OPWORD $A9BD ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetNewWindow ENDIF ; ; pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _NewCWindow: OPWORD $AA45 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION NewCWindow ENDIF ; ; pascal void DisposeWindow(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _DisposeWindow: OPWORD $A914 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION DisposeWindow ENDIF ; ; pascal void CloseWindow(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _CloseWindow: OPWORD $A92D ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CloseWindow ENDIF ; Routines available in Mac OS 8.5 and later ; ; pascal OSStatus CreateNewWindow(WindowClass windowClass, WindowAttributes attributes, const Rect *bounds, WindowPtr *outWindow) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CreateNewWindow ENDIF ; Create a window from a ‘wind’ resource ; ; pascal OSStatus CreateWindowFromResource(SInt16 resID, WindowPtr *outWindow) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CreateWindowFromResource ENDIF ; window persistence ; ; pascal OSStatus StoreWindowIntoCollection(WindowPtr window, Collection collection) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION StoreWindowIntoCollection ENDIF ; ; pascal OSStatus CreateWindowFromCollection(Collection collection, WindowPtr *outWindow) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CreateWindowFromCollection ENDIF ; window refcounting ; ; pascal OSStatus GetWindowOwnerCount(WindowPtr window, UInt32 *outCount) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowOwnerCount ENDIF ; ; pascal OSStatus CloneWindow(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CloneWindow ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Class Accessors (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal OSStatus GetWindowClass(WindowPtr window, WindowClass *outClass) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowClass ENDIF ; ; pascal OSStatus GetWindowAttributes(WindowPtr window, WindowAttributes *outAttributes) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowAttributes ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Floating Windows (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal OSStatus ShowFloatingWindows(void) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ShowFloatingWindows ENDIF ; ; pascal OSStatus HideFloatingWindows(void) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION HideFloatingWindows ENDIF ; ; pascal Boolean AreFloatingWindowsVisible(void) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION AreFloatingWindowsVisible ENDIF ; ; pascal WindowPtr FrontNonFloatingWindow(void) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION FrontNonFloatingWindow ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Background Imaging ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void SetWinColor(WindowPtr window, WCTabHandle newColorTable) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SetWinColor: OPWORD $AA41 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWinColor ENDIF ; ; pascal void SetDeskCPat(PixPatHandle deskPixPat) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SetDeskCPat: OPWORD $AA47 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetDeskCPat ENDIF ; Routines available in Mac OS 8.5 and later ; ; pascal OSStatus SetWindowContentColor(WindowPtr window, RGBColor *color) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowContentColor ENDIF ; ; pascal OSStatus GetWindowContentColor(WindowPtr window, RGBColor *color) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowContentColor ENDIF ; ; pascal OSStatus GetWindowContentPattern(WindowPtr window, PixPatHandle outPixPat) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowContentPattern ENDIF ; ; pascal OSStatus SetWindowContentPattern(WindowPtr window, PixPatHandle pixPat) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowContentPattern ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Low-Level Region & Painting Routines ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void ClipAbove(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _ClipAbove: OPWORD $A90B ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ClipAbove ENDIF ; ; pascal void SaveOld(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SaveOld: OPWORD $A90E ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SaveOld ENDIF ; ; pascal void DrawNew(WindowPtr window, Boolean update) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _DrawNew: OPWORD $A90F ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION DrawNew ENDIF ; ; pascal void PaintOne(WindowPtr window, RgnHandle clobberedRgn) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _PaintOne: OPWORD $A90C ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION PaintOne ENDIF ; ; pascal void PaintBehind(WindowPtr startWindow, RgnHandle clobberedRgn) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _PaintBehind: OPWORD $A90D ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION PaintBehind ENDIF ; ; pascal void CalcVis(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _CalcVis: OPWORD $A909 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CalcVis ENDIF ; ; pascal void CalcVisBehind(WindowPtr startWindow, RgnHandle clobberedRgn) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _CalcVisBehind: OPWORD $A90A ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CalcVisBehind ENDIF ; ; pascal Boolean CheckUpdate(EventRecord *theEvent) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _CheckUpdate: OPWORD $A911 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CheckUpdate ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window List ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal short FindWindow(Point thePoint, WindowPtr *window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _FindWindow: OPWORD $A92C ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION FindWindow ENDIF ; ; pascal WindowPtr FrontWindow(void ) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _FrontWindow: OPWORD $A924 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION FrontWindow ENDIF ; ; pascal void BringToFront(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _BringToFront: OPWORD $A920 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION BringToFront ENDIF ; ; pascal void SendBehind(WindowPtr window, WindowPtr behindWindow) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SendBehind: OPWORD $A921 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SendBehind ENDIF ; ; pascal void SelectWindow(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SelectWindow: OPWORD $A91F ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SelectWindow ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Misc Low-Level stuff ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void InitWindows(void ) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _InitWindows: OPWORD $A912 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION InitWindows ENDIF ; ; pascal void GetWMgrPort(GrafPtr *wPort) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetWMgrPort: OPWORD $A910 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWMgrPort ENDIF ; ; pascal void GetCWMgrPort(CGrafPtr *wMgrCPort) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetCWMgrPort: OPWORD $AA48 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetCWMgrPort ENDIF ; Routines available in Mac OS 8.5 and later ; ; pascal Boolean IsValidWindowPtr(GrafPtr grafPort) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION IsValidWindowPtr ENDIF ; ; pascal OSStatus InitFloatingWindows(void) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION InitFloatingWindows ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Various & Sundry Window Accessors ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void HiliteWindow(WindowPtr window, Boolean fHilite) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _HiliteWindow: OPWORD $A91C ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION HiliteWindow ENDIF ; ; pascal void SetWRefCon(WindowPtr window, long data) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SetWRefCon: OPWORD $A918 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWRefCon ENDIF ; ; pascal long GetWRefCon(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetWRefCon: OPWORD $A917 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWRefCon ENDIF ; ; pascal void SetWindowPic(WindowPtr window, PicHandle pic) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SetWindowPic: OPWORD $A92E ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowPic ENDIF ; ; pascal PicHandle GetWindowPic(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetWindowPic: OPWORD $A92F ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowPic ENDIF ; ; pascal short GetWVariant(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetWVariant: OPWORD $A80A ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWVariant ENDIF ; Routines available in Mac OS 8.0 (Appearance 1.0) and later ; ; pascal OSStatus GetWindowFeatures(WindowPtr window, UInt32 *outFeatures) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _GetWindowFeatures move.w #$0013,D0 dc.w $AA74 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowFeatures ENDIF ; ; pascal OSStatus GetWindowRegion(WindowPtr window, WindowRegionCode inRegionCode, RgnHandle ioWinRgn) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _GetWindowRegion move.w #$0014,D0 dc.w $AA74 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowRegion ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Update Events ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void InvalRect(const Rect *badRect) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _InvalRect: OPWORD $A928 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION InvalRect ENDIF ; ; pascal void InvalRgn(RgnHandle badRgn) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _InvalRgn: OPWORD $A927 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION InvalRgn ENDIF ; ; pascal void ValidRect(const Rect *goodRect) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _ValidRect: OPWORD $A92A ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ValidRect ENDIF ; ; pascal void ValidRgn(RgnHandle goodRgn) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _ValidRgn: OPWORD $A929 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ValidRgn ENDIF ; ; pascal void BeginUpdate(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _BeginUpdate: OPWORD $A922 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION BeginUpdate ENDIF ; ; pascal void EndUpdate(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _EndUpdate: OPWORD $A923 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION EndUpdate ENDIF ; Routines available in Mac OS 8.5 and later ; ; pascal OSStatus InvalWindowRgn(WindowPtr window, RgnHandle region) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION InvalWindowRgn ENDIF ; ; pascal OSStatus InvalWindowRect(WindowPtr window, const Rect *bounds) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION InvalWindowRect ENDIF ; ; pascal OSStatus ValidWindowRgn(WindowPtr window, RgnHandle region) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ValidWindowRgn ENDIF ; ; pascal OSStatus ValidWindowRect(WindowPtr window, const Rect *bounds) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ValidWindowRect ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • DrawGrowIcon ; ; DrawGrowIcon is deprecated in Mac OS 8.0 and later. Theme-savvy window defprocs ; include the grow box in the window frame automatically. ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void DrawGrowIcon(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _DrawGrowIcon: OPWORD $A904 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION DrawGrowIcon ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Titles ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void SetWTitle(WindowPtr window, ConstStr255Param title) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SetWTitle: OPWORD $A91A ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWTitle ENDIF ; ; pascal void GetWTitle(WindowPtr window, Str255 title) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetWTitle: OPWORD $A919 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWTitle ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Proxies (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal OSStatus SetWindowProxyFSSpec(WindowPtr window, const FSSpec *inFile) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowProxyFSSpec ENDIF ; ; pascal OSStatus GetWindowProxyFSSpec(WindowPtr window, FSSpec *outFile) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowProxyFSSpec ENDIF ; ; pascal OSStatus SetWindowProxyAlias(WindowPtr window, AliasHandle alias) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowProxyAlias ENDIF ; ; pascal OSStatus GetWindowProxyAlias(WindowPtr window, AliasHandle *alias) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowProxyAlias ENDIF ; ; pascal OSStatus SetWindowProxyCreatorAndType(WindowPtr window, OSType fileCreator, OSType fileType, SInt16 vRefNum) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowProxyCreatorAndType ENDIF ; ; pascal OSStatus GetWindowProxyIcon(WindowPtr window, IconRef *outIcon) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowProxyIcon ENDIF ; ; pascal OSStatus SetWindowProxyIcon(WindowPtr window, IconRef icon) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowProxyIcon ENDIF ; ; pascal OSStatus RemoveWindowProxy(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION RemoveWindowProxy ENDIF ; ; pascal OSStatus BeginWindowProxyDrag(WindowPtr window, DragReference *outNewDrag, RgnHandle outDragOutlineRgn) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION BeginWindowProxyDrag ENDIF ; ; pascal OSStatus EndWindowProxyDrag(WindowPtr window, DragReference theDrag) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION EndWindowProxyDrag ENDIF ; ; pascal OSStatus TrackWindowProxyFromExistingDrag(WindowPtr window, Point startPt, DragReference drag, RgnHandle inDragOutlineRgn) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION TrackWindowProxyFromExistingDrag ENDIF ; ; pascal OSStatus TrackWindowProxyDrag(WindowPtr window, Point startPt) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION TrackWindowProxyDrag ENDIF ; ; pascal Boolean IsWindowModified(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION IsWindowModified ENDIF ; ; pascal OSStatus SetWindowModified(WindowPtr window, Boolean modified) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowModified ENDIF ; ; pascal Boolean IsWindowPathSelectClick(WindowPtr window, EventRecord *event) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION IsWindowPathSelectClick ENDIF ; ; pascal OSStatus WindowPathSelect(WindowPtr window, MenuHandle menu, SInt32 *outMenuResult) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION WindowPathSelect ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • HiliteWindowFrameForDrag (Mac OS 8.5 and later) ; ; If you call ShowDragHilite and HideDragHilite, you don’t need to use this routine. ; If you implement custom drag hiliting, you should call HiliteWindowFrameForDrag ; when the drag is tracking inside a window with drag-hilited content. ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal OSStatus HiliteWindowFrameForDrag(WindowPtr window, Boolean hilited) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _HiliteWindowFrameForDrag moveq #25,D0 dc.w $A829 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION HiliteWindowFrameForDrag ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Transitions (Mac OS 8.5 and later) ; ; TransitionWindow displays a window with accompanying animation and sound. ; —————————————————————————————————————————————————————————————————————————————————————— ; typedef UInt32 WindowTransitionEffect kWindowZoomTransitionEffect EQU 1 ; Finder-like zoom rectangles, use with Show or Open transition actions ; typedef UInt32 WindowTransitionAction kWindowShowTransitionAction EQU 1 ; param is rect in global coordinates from which to start the animation kWindowHideTransitionAction EQU 2 ; param is rect in global coordinates at which to end the animation ; ; pascal OSStatus TransitionWindow(WindowPtr window, WindowTransitionEffect effect, WindowTransitionAction action, const Rect *rect) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION TransitionWindow ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Positioning ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void MoveWindow(WindowPtr window, short hGlobal, short vGlobal, Boolean front) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _MoveWindow: OPWORD $A91B ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION MoveWindow ENDIF ; ; pascal void SizeWindow(WindowPtr window, short w, short h, Boolean fUpdate) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _SizeWindow: OPWORD $A91D ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SizeWindow ENDIF ; ; pascal long GrowWindow(WindowPtr window, Point startPt, const Rect *bBox) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GrowWindow: OPWORD $A92B ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GrowWindow ENDIF ; ; pascal void DragWindow(WindowPtr window, Point startPt, const Rect *boundsRect) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _DragWindow: OPWORD $A925 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION DragWindow ENDIF ; ; pascal void ZoomWindow(WindowPtr window, short partCode, Boolean front) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _ZoomWindow: OPWORD $A83A ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ZoomWindow ENDIF ; Routines available in Mac OS 8.0 (Appearance 1.0) and later ; ; pascal Boolean IsWindowCollapsable(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _IsWindowCollapsable move.w #$000F,D0 dc.w $AA74 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION IsWindowCollapsable ENDIF ; ; pascal Boolean IsWindowCollapsed(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _IsWindowCollapsed move.w #$0010,D0 dc.w $AA74 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION IsWindowCollapsed ENDIF ; ; pascal OSStatus CollapseWindow(WindowPtr window, Boolean collapse) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _CollapseWindow move.w #$0011,D0 dc.w $AA74 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CollapseWindow ENDIF ; ; pascal OSStatus CollapseAllWindows(Boolean collapse) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _CollapseAllWindows move.w #$0012,D0 dc.w $AA74 EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION CollapseAllWindows ENDIF ; Routines available in Mac OS 8.5 and later ; ; pascal OSStatus RepositionWindow(WindowPtr window, WindowPtr parentWindow, WindowPositionMethod method) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION RepositionWindow ENDIF ; ; pascal OSStatus SetWindowBounds(WindowPtr window, WindowRegionCode regionCode, const Rect *globalBounds) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowBounds ENDIF ; ; pascal OSStatus GetWindowBounds(WindowPtr window, WindowRegionCode regionCode, Rect *globalBounds) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowBounds ENDIF ; ; pascal OSStatus MoveWindowStructure(WindowPtr window, short hGlobal, short vGlobal) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION MoveWindowStructure ENDIF ; ; pascal Boolean ResizeWindow(WindowPtr window, Point startPoint, const Rect *sizeConstraints, Rect *newContentRect) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ResizeWindow ENDIF ; ; pascal Boolean IsWindowInStandardState(WindowPtr window, Point *idealSize, Rect *idealStandardState) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION IsWindowInStandardState ENDIF ; ; pascal OSStatus ZoomWindowIdeal(WindowPtr window, SInt16 partCode, Point *ioIdealSize) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ZoomWindowIdeal ENDIF ; ; pascal OSStatus GetWindowIdealUserState(WindowPtr window, Rect *userState) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowIdealUserState ENDIF ; ; pascal OSStatus SetWindowIdealUserState(WindowPtr window, Rect *userState) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowIdealUserState ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Visibility ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal void HideWindow(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _HideWindow: OPWORD $A916 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION HideWindow ENDIF ; ; pascal void ShowWindow(WindowPtr window) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _ShowWindow: OPWORD $A915 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ShowWindow ENDIF ; ; pascal void ShowHide(WindowPtr window, Boolean showFlag) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _ShowHide: OPWORD $A908 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ShowHide ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Properties (Mac OS 8.5 and later) ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal OSStatus GetWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowProperty ENDIF ; ; pascal OSStatus GetWindowPropertySize(WindowPtr window, PropertyCreator creator, PropertyTag tag, UInt32 *size) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetWindowPropertySize ENDIF ; ; pascal OSStatus SetWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag, UInt32 propertySize, void *propertyBuffer) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION SetWindowProperty ENDIF ; ; pascal OSStatus RemoveWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag) ; IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION RemoveWindowProperty ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Utilities ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal long PinRect(const Rect *theRect, Point thePt) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _PinRect: OPWORD $A94E ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION PinRect ENDIF ; ; pascal RgnHandle GetGrayRgn(void) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _GetGrayRgn &dest=(sp) move.l $09EE,&dest EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetGrayRgn ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Window Part Tracking ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal Boolean TrackBox(WindowPtr window, Point thePt, short partCode) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _TrackBox: OPWORD $A83B ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION TrackBox ENDIF ; ; pascal Boolean TrackGoAway(WindowPtr window, Point thePt) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _TrackGoAway: OPWORD $A91E ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION TrackGoAway ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • Region Dragging ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _DragGrayRgn: OPWORD $A905 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION DragGrayRgn ENDIF ; ; pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _DragTheRgn: OPWORD $A926 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION DragTheRgn ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • GetAuxWin ; ; Avoid using GetAuxWin if at all possible ; —————————————————————————————————————————————————————————————————————————————————————— ; ; pascal Boolean GetAuxWin(WindowPtr window, AuxWinHandle *awHndl) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN _GetAuxWin: OPWORD $AA42 ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION GetAuxWin ENDIF ; —————————————————————————————————————————————————————————————————————————————————————— ; • MixedMode & ProcPtrs ; —————————————————————————————————————————————————————————————————————————————————————— ; —————————————————————————————————————————————————————————————————————————————————————— ; • C Glue ; —————————————————————————————————————————————————————————————————————————————————————— ; —————————————————————————————————————————————————————————————————————————————————————— ; • WindowRecord accessor macros ; —————————————————————————————————————————————————————————————————————————————————————— ; ; ***************************************************************************** ; * * ; * The conditional STRICT_WINDOWS has been removed from this interface file. * ; * The accessor macros to a WindowRecord are no longer necessary. * ; * * ; * All ≈Ref Types have reverted to their original Handle and Ptr Types. * ; * * ; ***************************************************************************** ; ; Details: ; The original purpose of the STRICT_ conditionals and accessor macros was to ; help ease the transition to Copland. Shared data structures are difficult ; to coordinate in a preemptive multitasking OS. By hiding the fields in a ; WindowRecord and other data structures, we would begin the migration to the ; discipline wherein system data structures are completely hidden from ; applications. ; ; After many design reviews, we finally concluded that with this sort of ; migration, the system could never tell when an application was no longer ; peeking at a WindowRecord, and thus the data structure might never become ; system owned. Additionally, there were many other limitations in the ; classic toolbox that were begging to be addressed. The final decision was ; to leave the traditional toolbox as a compatibility mode. ; ; We also decided to use the Handle and Ptr based types in the function ; declarations. For example, NewWindow now returns a WindowPtr rather than a ; WindowRef. The Ref types are still defined in the header files, so all ; existing code will still compile exactly as it did before. There are ; several reasons why we chose to do this: ; ; - The importance of backwards compatibility makes it unfeasible for us to ; enforce real opaque references in the implementation anytime in the ; foreseeable future. Therefore, any opaque data types (e.g. WindowRef, ; ControlRef, etc.) in the documentation and header files would always be a ; fake veneer of opacity. ; ; - There exists a significant base of books and sample code that neophyte ; Macintosh developers use to learn how to program the Macintosh. These ; books and sample code all use direct data access. Introducing opaque data ; types at this point would confuse neophyte programmers more than it would ; help them. ; ; - Direct data structure access is used by nearly all Macintosh developers. ; Changing the interfaces to reflect a false opacity would not provide any ; benefit to these developers. ; ; - Accessor functions are useful in and of themselves as convenience ; functions. ; ; - Note: some accessor names conflict with API's in Win32 and have been renamed ; to have a Mac prefix (QuickTime 3.0). ; ENDIF ; __MACWINDOWS__